{layout name="layout" /}
<div class="table-tip fn-clear">
    <div class="fn-right">
        共有数据 <span class="red">{$counts}</span> 条
    </div>
</div>
<table class="table">
    <colgroup>
        <col class="w80" />
        <col class="w200" />
        <col/>
        <col class="w140" />
        <col class="w140" />
        <col class="w140" />
        <col class="w140" />
        <col class="w60" />
        <col class="w80" />
    </colgroup>
    <thead>
        <tr>
            <th class="fn-tac">#</th>
            <th>登录次数</th>
            <th>用户名</th>
            <th>最后登录IP</th>
            <th>最后登录时间</th>
            <th>创建日期</th>
            <th>更新日期</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
{volist name="lists" id="rs"}
    <tr>
        <td class="fn-tac">{$rs.id}</td>
        <td>{$rs.view}</td>
        <td>{$rs.nickname}</td>
        <td>{$rs.last_login_ip}</td>
        <td>{$rs.last_login_time|date="Y-m-d H:i:s",###}</td>
        <td>{$rs.create_time}</td>
        <td>{$rs.update_time}</td>
        <td>
            {if condition="$rs.locks"}
                <span class="badge">锁定</span>
            {else}
                <span class="badge bg-green">正常</span>
            {/if}
        </td>
        <td>
            {if condition="$rs.locks"}
                <a class="a-button isDel" url="{:url('passport/user/lock',['id'=>$rs.id,'locks'=>0])}" href="javascript:;" data-rules="delete"><i class="iconfont icon-suoding"></i> {$Think.lang.lang_ui_start}</a>
            {else}
                <a class="a-button isDel" url="{:url('passport/user/lock',['id'=>$rs.id,'locks'=>1])}" href="javascript:;" data-rules="delete"><i class="iconfont icon-suoding"></i> {$Think.lang.lang_ui_lock}</a>
            {/if}
        </td>
    </tr>
{/volist}
</tbody>
</table>
<div class="page">{$page}</div>
<script type="text/javascript">
Do('base','layer',function(){
    $(".isDel").click(function(){
        var url = $(this).attr("url");
        var css = this;
        var index = parent.layer.getFrameIndex(window.name); 
        parent.layer.confirm('确认要操作本资源?',{icon: 3,title:'友情提示'}, function(index){
            $.getJSON(url,function(data) {
                parent.layer.close(index);
                if (data.code == 1){
                    parent.layer.msg(data.message,{icon:5})
                }else{
                    location.reload();
                }
            });
        });
    })
})
</script>